package cn.com.yinhex.util;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

public class IntHelp {
    public static String longGB(long value){
        BigDecimal a =  new BigDecimal(String.valueOf(value));
        BigDecimal b = new BigDecimal("1000000000");
        float f = a.divide(b, 3, BigDecimal.ROUND_HALF_UP).floatValue();
        return String.valueOf(f);
        
    }
    public static String maxNum(long value){
        String strNum = String.valueOf(value);
        String div ="1";
        for(int i = 0;i<strNum.length()-1;i++){
            div +="0";
        }
        System.out.println("div===="+div);
        int  divNum = Integer.valueOf(div);
        System.out.println(divNum+"divNum======");
        
        BigDecimal a =  new BigDecimal(strNum);
        BigDecimal b = new BigDecimal(divNum);
        float f = a.divide(b, 1, BigDecimal.ROUND_HALF_UP).floatValue()+0.99999999999999f;
        int i = (int) f;
        long  result = i*divNum;
        System.out.println(result+"----");
        return String.valueOf(result);
    }
  public static String long2Date(long dl){
      Date  date   = new Date(dl);
      SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      String ds =  df.format(date);
      return ds;
      
  }
   public static void main(String args[]){
       long ls = 1312887121629L;
       String i = IntHelp.maxNum(1233333333L);
       System.out.println(i);
       String str = IntHelp.long2Date(ls);
       System.out.println(str);
         
       
   }

}
